package com.smartwebx.ha.web.admin.module.screen.report;

import java.io.PrintWriter;
import java.util.List;

import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

import org.springframework.beans.factory.annotation.Autowired;

import com.alibaba.citrus.turbine.dataresolver.Param;
import com.alibaba.citrus.turbine.dataresolver.Params;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.smartwebx.ha.biz.assign.HaUserManager;
import com.smartwebx.ha.dal.assign.dao.HaUserMapper;
import com.smartwebx.ha.usebean.Paging;

public class AjaxCommonReport {
	@Autowired
	private HaUserMapper haUserDao;
	@Autowired
	private HttpServletResponse response;
	@Autowired
	private HaUserManager haUserManager;
	@Autowired
	private HttpSession session;
	
	public void execute(@Params Paging page, @Param("call") String call, @Param("number") String number) throws Exception{
		System.out.println(call);
		response.setContentType("application/json");
		PrintWriter out=response.getWriter();
		ObjectMapper mapper= new ObjectMapper();
		AjaxCommonReportDal a = new AjaxCommonReportDal();
		List<CommonReport> users = a.getData(page, call, number);
		
		mapper.writeValue(out, users);
	}
}
